<template>
	<view>
		<view class="head">
			<view class="head_left" @tap="back()">
				<image src="../../../static/wode/return.png" mode=""></image>
				<text>返回</text>
			</view>
			<view class="head_mid" v-if="detailsData.account">
				充值
			</view>
			<view class="head_mid" v-else>
				兑换
			</view>
			<view class="head_right">
		
			</view>
		</view>
		<view class="body">
			<view class="title">
				<text>猫币个数</text>
				<text v-if="transaction_type=='true'">+{{detailsData.pay_count}}</text>
				<text v-else>-{{detailsData.pay_count}}</text>
			</view>
			<view class="body_item">
				<view class="item">
					<text class="text1">类型</text>
					<text class="text2" v-if="transaction_type=='true'">收益</text>
					<text class="text2" v-else>支出</text>
				</view>
				<view class="item">
					<text class="text1">时间</text>
					<text class="text2">{{detailsData.create_time}}</text>
				</view>
				<view class="item">
					<text class="text1">交易单号</text>
					<text class="text2">{{detailsData.order_no}}</text>
				</view>
				<view class="item">
					<text class="text1">备注</text>
					<text class="text2">{{detailsData.remarks}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				detailsData:[],
				transaction_type:'',
			};
		},
		onLoad(option) {
			this.id=option.id
			this.transaction_type=option.transaction_type
			this.getData()
		},
		methods:{
			back() { //返回
				uni.navigateBack({
					delta: 1
				})
			},
			getData(){
				var me=this
				var data={
					id:this.id
				}
				this.myAjaxNew({
					model: 'user',
					controllerName: 'userOrder',
					actionName: 'queryDetailListPage',
					data: data,
					successBack: function(res) {
						console.log(res,'详情')
						me.detailsData=res.data.data[0]
					},
				})
			},
		}
	}
</script>

<style scoped>
	.head {
		display: flex;
		justify-content: space-between;
		height: 128upx;
		background: #ffffff;
		padding: 0 24upx;
		margin-bottom: 20upx;
	}
	
	.head image {
		width: 20upx;
		height: 36upx;
		margin-right: 9upx;
	}
	
	.head_left {
		display: flex;
		align-items: center;
		color: #666666;
		font-size: 32upx;
	}
	
	.head_mid {
		color: #333333;
		font-size: 36upx;
	}
	
	.head_right {
		width: 120upx;
	}
	.body{
		background: #FFFFFF;
		
	}
.title{
	color: #333333;
	font-size: 36upx;
	display: flex;
	justify-content: space-between;
	padding: 0 24upx;
	height: 130upx;
	line-height: 130upx;
	border-bottom: 1upx solid #E6E6E6;
}
.body_item{
	padding: 50upx 24upx 0 24upx;
}
.item{
	display: flex;
	justify-content: space-between;
	padding-bottom: 40upx;
}
.text1{
	color: #999999;
	font-size: 32upx;
}
.text2{
	color: #333333;
	font-size: 32upx;
}


</style>
